//
//  CommonImageService.h
//  TKnowBox
//
//  Created by milo on 15/6/14.
//  Copyright (c) 2015年 knowin. All rights reserved.
//

#import "SimBaseVC.h"
#import "SimImageEditModel.h"
#import "SimPhotoBrowser.h"

typedef NS_ENUM(NSInteger, ImagePickerType)
{
    IPT_Camera,
    IPT_SinglePhoto,
    IPT_MulPhoto,
};

typedef NS_ENUM(NSInteger, ImagePickerSelectIndexType)
{
    IPSIT_Camera,
    IPSIT_Photo,
    IPSIT_Cancel,
};

SimDefineValue(kSimImagePickerShadowImage, UIImage *);
SimDefineValue(kSimImagePickerNavBarColor, UIColor *);
SimDefineValue(kSimImagePickerNavarStyle, NSNumber *);


//Picker
@class SimImagePickerKit;
typedef void(^DidFinishPickerWithImages)(NSArray *images);
typedef void(^DidFinishImageBrowser)(SimPhotoBrowser *browser, BOOL);


@interface SimImagePickerKit : NSObject

+ (instancetype)instance; //create instance by the method
@property (nonatomic, strong) DidFinishImageBrowser finishImageBrowser;

//Action Sheet
+ (void)showActionSheet:(NSString *)title select:(void(^)(NSInteger selectedIndex))selectedBlock;

//Picker
- (void)showImagePickerInVC:(UIViewController *)vc;
@property (nonatomic) ImagePickerType pickerType;
@property (nonatomic) NSInteger currentCount; //IPT_MulPhoto
@property (nonatomic) NSInteger maxPicCount;  //IPT_MulPhoto
@property (nonatomic) BOOL allowsEditing;     //IPT_SinglePhoto
@property (nonatomic, strong) DidFinishPickerWithImages finishPickerWithImages;

//Browser
@property (nonatomic) NSInteger initIndex;
@property (nonatomic, strong) NSArray *imageContents;
@property (nonatomic, weak) SimPhotoBrowser *photoBrowserVC;
- (SimPhotoBrowser *)showImageBrowserInVC:(UIViewController *)vc;

//Edit Browser
- (void)showImagewEditInVC:(UIViewController *)vc;

+ (BOOL)checkMediaAuthStatus:(BOOL)isPhoto;

@end
